layui.config({
    base: "js/"
}).use(['form', 'layer', 'jquery', 'layedit', 'table'], function () {
    form = layui.form(),
        layer = parent.layer === undefined ? layui.layer : parent.layer,
        laypage = layui.laypage,
        layedit = layui.layedit,
        laydate = layui.laydate,
        $ = layui.jquery;

    $(function () {
        /*请求查询部门的controller*/
        $.ajax({
            type: "POST",
            url: "XiaoJianEmpController/selectDept",
            dataType: "JSON",
            data: "",
            success: function (msg1) {
                $.each(msg1, function (i, data1) {
                    $("#sel1").append("<option value='" + data1.id + "'>" + data1.dname + "</option>")
                })
                form.render();
            },
            error: function () {
                alert("error")
            }
        });
        /*请求查询职位的controller  job职称 dupt职位*/
        $.ajax({
            type: "POST",
            url: "XiaoJianEmpController/selectJob",
            dataType: "JSON",
            data: "",
            success: function (msg) {
                $.each(msg, function (i, data) {
                    $("#sel2").append("<option value='" + data.id + "'>" + data.name + "</option>")
                })
                form.render();
            },
            error: function () {
                alert("error")
            }
        });
        /*请求查询职称的controller*/
        $.ajax({
            type: "POST",
            url: "XiaoJianEmpController/selectDuct",
            dataType: "JSON",
            data: "",
            success: function (msg) {
                $.each(msg, function (i, data) {
                    $("#sel3").append("<option value='" + data.id + "'>" + data.zname + "</option>")
                })
                form.render();
            },
            error: function () {
                alert("error")
            }
        });


    })

})
